import { createApp } from "vue";
import App from "./App.vue";
import router from "./router/router";
import store from "./store/store";
import "@/assets/css/reset.scss";
import "@/assets/css/common.scss";
import util from "@/plugin/util";
import dict from "@/plugin/dict";
import axios from "@/plugin/axios";
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
import hzButton from "@/components/button/hz-button";
import hzTable from '@/components/table/hz-table.vue'
import hzDialog from '@/components/hz-dialog.vue'
import "default-passive-events";

// import * as dd from '@/mock/mock'
if (process.env.NODE_ENV === 'development') {
  // require('@/mock/mock') -- 对上传功能有影响
}

window.util = util;
window.logObj = (obj) => {return (JSON.parse(JSON.stringify(obj)))}
let app = createApp(App);
app.config.globalProperties.$util = util;  // getCurrentInstance().appContext.config.globalProperties.util可在模板表达式中使用
app.config.globalProperties.$dict = dict; 
app.config.globalProperties.$http = axios; 
app.use(ElementPlus);


// 全局注册element icon
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}
app.component("hzButton", hzButton);
app.component("hzTable", hzTable);
app.component("hzDialog", hzDialog);

app.use(store).use(router).mount("#app");
